<?php

namespace yan\editor_frontend\editorxml;

use yii\helpers\Html;

class WebCollapseWidget extends WebWidget
{
    public function run()
    {
        $options = $this->options;
        $shtml = '';
        if ($this->parent_type == 'listContainer') {
            $inner = '<div class="faq_list_title opbtn">
						<h3>' . $this->value['value']['title'] . '</h3>
					</div>';
            $inner .= '<div class="faq_list_content opcon">
						' . \common\utils\Helper::showContent($this->value['value']['options']) . '
					</div>';
            $options['class'] = $options['class'].' faq_list_title opbtn'
            $shtml = Html::tag('li', $inner, $options);
        }else{
            $inner = '<div class="faq_list_title opbtn">
                        <h3>' . $this->value['value']['title'] . '</h3>
                    </div>';
            $inner .= '<div class="faq_list_content opcon">
                        ' . \common\utils\Helper::showContent($this->value['value']['options']) . '
                    </div>';
            $shtml = Html::tag('div', $inner, $options);
        }
        return $shtml;
    }
}
